package day11;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author oldliu
 * @since 1.0
 */
public class ClsTest3 {
    public static void main(String[] args) {
        try {
            Class<?> aClass = Class.forName("java.lang.String");
            Class<String> c2 = String.class;
            System.out.println(aClass==c2);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        //创建了长度是10，的double类型的数组
        Object o = Array.newInstance(double.class, 10);
       double[]d=(double[])o;

        Array.set(o,0,4.6);
        Array.set(o,1,4.2);
        Array.set(o,2,4.455);
        System.out.println(Arrays.toString(d));
        System.out.println(Array.get(o,1));
    }
}
